<?php


namespace app\event\plugin\admin;


use plugin\admin\app\model\SysLogininfor;

class Login
{

    /**
     * 登录日志写入
     * @param $data
     */
    function loginWriting($data)
    {
        $add['user_name']=$data['user_name'];
        $add['ipaddr']=request()->getRealIp();
        $add['status']=$data['status']??0;
        $add['msg']=$data['data']??0;
        $add['access_time']=date('Y-m-d H:i:s');
        SysLogininfor::insert($add);
    }
}